﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcreport.Web
{
    public partial class nmjb : System.Web.UI.Page
    {
        lcreport.BLL.reportinfo bll = new lcreport.BLL.reportinfo();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BindData();

        }
        public void BindData()
        {
            DataSet ds = new DataSet();
            StringBuilder strWhere = new StringBuilder();
            if (txtKeyword.Text.Contains("'") || txtKeyword.Text.Contains("=")) return;
            if (txtKeyword.Text.Trim() != "")
            {
                strWhere.AppendFormat(" and spwd ='{0}'", txtKeyword.Text.Trim());
            }
            else
            {
                return;
            }
            ds = bll.GetList(strWhere.ToString());
            gridView.DataSource = ds;
            gridView.DataBind();
            if (ds.Tables[0].Rows.Count == 0)
            {
                Maticsoft.Common.MessageBox.Show(this, "对不起，没有找到相关纪录！");
            }
        }
    }
}